<div class="grid_9">


<?php if($this->session->flashdata('type')): ?>
	<div class="<?php echo $this->session->flashdata('type')?>"><?php echo $this->session->flashdata('msg')?></div>
<?php elseif(validation_errors()): ?>
	<div class="error">Please provide the correct details for the fields marked with *</div>
<?php endif; ?>

<div class="inner-border">
<h6>Add Student</h6>
	<?php
$formAttrib = array('class'=> 'admin-form', 'name' => 'frm_addstudent');
$idNo = rand(1000, 3000);
$studentType = $studentTypeAttrib = array('1' => 'Select Student Type...', 'New' => 'New', 'Old' => 'Old', 'Returnee' => 'Returnee', 'Cross' => 'Cross' );

//Account Details
$idNoAttrib = array('name' => 'id_no', 'value' => $idNo, 'id' => 'id_no', 'readonly' => 'readonly');
$userNameAttrib = array('name' => 'username', 'value' => $idNo, 'id' => 'username', 'readonly' => 'readonly');
$passwordAttrib = array('name' => 'password', 'value' => $idNo, 'id' => 'password', 'readonly' => 'readonly');
$courseAttrib = array('name' => 'course', 'value' => '', 'readonly' => 'readonly', 'id' => 'course');
$selectCourseAttrib = array('name' => 'selectcourse', 'id' => 'selectcourse', 'content' => 'Select Course', 'type' => 'button', 'onClick' => 'open_url(\''.site_url("admin/select_course").'\')');
$yearLevelAttrib = array('a' => 'Select year level...');
foreach($db_entries as $db_entry){
	$yearLevelAttrib[$db_entry->id] = $db_entry->level_name;
}


// Personal Information fields
$lNameAttrib = array('name' => 'lastname', 'id' => 'lastname', 'value' => set_value('lastname'));
$fNameAttrib = array('name' => 'firstname', 'id' => 'firstname', 'value' => set_value('firstname'));
$mNameAttrib = array('name' => 'middlename', 'id' => 'middlename', 'value' => set_value('middlename'));
$genderAttrib = array('1' => 'Select Gender...', 'Male' => 'Male', 'Female' => 'Female' );
$civilStatusAttrib = array('1' => 'Select Civil Status...', 'Single' => 'Single', 'Married' => 'Married', 'Divorced' => 'Divorced' );
$dobAttrib = array('name' => 'dob', 'id' => 'dob', 'value' => set_value('dob'), 'class' => 'date-picker');
$pobAttrib = array('name' => 'pob', 'id' => 'pob', 'value' => set_value('pob'));
$ageAttrib = array('name' => 'age', 'id' => 'age', 'value' => set_value('age'));
$disabilityAttrib = array('name' => 'disability', 'id' => 'disability');
$nationalityAttrib = array('name' => 'nationality', 'id' => 'nationality', 'value' => set_value('nationality'));
$religionAttrib = array('name' => 'religion', 'id' => 'religion', 'value' => set_value('religion'));
$contactNumberAttrib = array('name' => 'contactnumber', 'id' => 'contactnumber');
$emailAttrib = array('name' => 'email', 'id' => 'email');
$presentAddressAttrib = array('name' =>'presentaddress', 'id' => 'presentaddress', 'value' => set_value('presentaddress'));
$fatherNameAttrib = array('name' => 'fathername', 'id' => 'fathername', 'value' => set_value('fathername'));
$fatherOccupationAttrib = array('name' => 'fatheroccupation', 'id' => 'fatheroccupation', 'value' => set_value('fatheroccupation'));
$fatherContactAttrib = array('name' => 'fathercontact', 'id' => 'fathercontact', 'value' => set_value('fathercontact'));
$motherNameAttrib = array('name' => 'mothername', 'id' => 'mothername', 'value' => set_value('mothername'));
$motherOccupationAttrib = array('name' => 'motheroccupation', 'id' => 'motheroccupation', 'value' => set_value('motheroccupation'));
$motherContactAttrib = array('name' => 'mothercontact', 'id' => 'mothercontact', 'value' => set_value('mothercontact'));
$parentAddressAttrib = array('name' => 'parentaddress', 'id' => 'parentaddress', 'value' => set_value('parentaddress'));
$guardianNameAttrib = array('name' => 'guardianname', 'id' => 'guardianname', 'value' => set_value('guardianname'));
$relationshipAttrib = array('name' => 'relationship', 'id' => 'relationship');
$guardianContactAttrib = array('name' => 'guardiancontact', 'id' => 'guardiancontact', 'value' => set_value('guardiancontact'));
$guardianAddressAttrib = array('name' => 'guardianaddress', 'id' => 'guardianaddress', 'value' => set_value('guardianaddress'));

// Academic data fields
	//Elementary
$eNameSchoolAttrib = array('name' => 'eschoolname', 'id' => 'eschoolname', 'value' => set_value('eschoolname'));
$eSchoolAddressAttrib = array('name' => 'eschooladdress', 'id' => 'eschooladdress', 'value' => set_value('eschooladdress'));
$eYearGraduateAttrib = array('name' => 'eyeargraduate', 'id' => 'eyeargraduate', 'value' => set_value('eyeargraduate'));
	//Secondary
$sNameSchoolAttrib = array('name' => 'sschoolname', 'id' => 'sschoolname', 'value' => set_value('sschoolname'));
$sSchoolAddressAttrib = array('name' => 'sschooladdress', 'id' => 'sschooladdress', 'value' => set_value('sschooladdress'));
$sYearGraduateAttrib = array('name' => 'syeargraduate', 'id' => 'syeargraduate', 'value' => set_value('syeargraduate'));
	//Vocational
$vNameSchoolAttrib = array('name' => 'vschoolname', 'id' => 'vschoolname', 'value' => set_value('vschoolname'));
$vSchoolAddressAttrib = array('name' => 'vschooladdress', 'id' => 'vschooladdress', 'value' => set_value('vschooladdress'));
$vYearGraduateAttrib = array('name' => 'vyeargraduate', 'id' => 'vyeargraduate', 'value' => set_value('vyeargraduate'));
	//tertiary
$tNameSchoolAttrib = array('name' => 'tschoolname', 'id' => 'tschoolname', 'value' => set_value('tschoolname'));
$tSchoolAddressAttrib = array('name' => 'tschooladdress', 'id' => 'tschooladdress', 'value' => set_value('tschooladdress'));
$tYearGraduateAttrib = array('name' => 'tyeargraduate', 'id' => 'tyeargraduate', 'value' => set_value('tyeargraduate'));
	//Others
$oNameSchoolAttrib = array('name' => 'oschoolname', 'id' => 'oschoolname', 'value' => set_value('oschoolname'));
$oSchoolAddressAttrib = array('name' => 'oschooladdress', 'id' => 'oschooladdress', 'value' => set_value('oschooladdress'));
$oYearGraduateAttrib = array('name' => 'oyeargraduate', 'id' => 'oyeargraduate', 'value' => set_value('oyeargraduate'));
?>

<?php echo form_open('admin/add_student', $formAttrib); ?>

<?php echo form_fieldset('Account Details');?>
<div class="input-block">
	<?php
		echo form_label('IDNO', 'id_no');
		echo form_input($idNoAttrib);		
	?>
</div>
<div class="input-block">
 	<?php
		echo form_label('Student type <strong>*</strong>', 'studenttype');
    	echo form_dropdown('studenttype', $studentTypeAttrib, '1');
	?>
</div>

<div class="input-block">
    <?php
		echo form_label('Username', 'username');
		echo form_input($userNameAttrib);		
	?>
    </div>
    
    <div class="input-block">
    <?php
		echo form_label('Password', 'password');
		echo form_password($passwordAttrib);
	?>
    </div>
    
    <div class="input-block">
    <?php
		echo form_label('Course <strong>*</strong>', 'course');
		echo form_input($courseAttrib);
		echo form_button($selectCourseAttrib);
		echo form_hidden('course_code', set_value('course_code'));
	?>
    	
    </div>
    
    <div class="input-block">
	<?php
		echo form_label('Year Level <strong>*</strong>', 'year_level_id');
    	echo form_dropdown('year_level_id', $yearLevelAttrib, 'a');
	?>
    </div>
<?php echo form_fieldset_close(); ?>

<?php echo form_fieldset('Personal Information');?>
<div class="input-block">
 	<?php
		echo form_label('Last Name <strong>*</strong>', 'lastname');
    	echo form_input($lNameAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('First Name <strong>*</strong>', 'firstname');
    	echo form_input($fNameAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Middlename Name <strong>*</strong>', 'middlename');
    	echo form_input($mNameAttrib);
	?>
</div>


<div class="input-block">
 	<?php
		echo form_label('Gender <strong>*</strong>', 'gender');
    	echo form_dropdown('gender', $genderAttrib, '1');
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Civil Status ', 'civilstatus');
    	echo form_dropdown('civilstatus', $civilStatusAttrib, '1');
	?>
</div>


<div class="input-block">
 	<?php
		echo form_label('Date of Birth ', 'dob');
    	echo form_input($dobAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Place of Birth ', 'pob');
    	echo form_input($pobAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Age ', 'age');
    	echo form_input($ageAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Disability', 'disability');
    	echo form_input($disabilityAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Nationality ', 'nationality');
    	echo form_input($nationalityAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Religion ', 'religion');
    	echo form_input($religionAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Contact Number ', 'contactnumber');
    	echo form_input($contactNumberAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Email', 'email');
    	echo form_input($emailAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Present Address ', 'presentaddress');
    	echo form_input($presentAddressAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Father\'s Name ', 'fathername');
    	echo form_input($fatherNameAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Occupation ', 'fatheroccupation');
    	echo form_input($fatherOccupationAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Contact Number ', 'fathercontact');
    	echo form_input($fatherContactAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Mother\'s Name ', 'mothername');
    	echo form_input($motherNameAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Occupation ', 'motheroccupation');
    	echo form_input($motherOccupationAttrib);
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Contact Number ', 'mothercontact');
    	echo form_input($motherContactAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Parent\'s Address ', 'parentaddress');
    	echo form_input($parentAddressAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Guardian Name ', 'guardianname');
    	echo form_input($guardianNameAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Relationship ', 'relationship');
    	echo form_input($relationshipAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Contact Number ', 'guardiancontact');
    	echo form_input($guardianContactAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Guardian Address ', 'guardianaddress');
    	echo form_input($guardianAddressAttrib);	
	?>
</div>

<?php echo form_fieldset_close();?>

<?php echo form_fieldset('Elementary');?>

<div class="input-block">
 	<?php
		echo form_label('School Name ', 'eschoolname');
    	echo form_input($eNameSchoolAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('School Address ', 'eschooladdress');
    	echo form_input($eSchoolAddressAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Year Graduated ', 'eyeargraduate');
    	echo form_input($eYearGraduateAttrib);	
	?>
</div>

<?php echo form_fieldset_close();?>

<?php echo form_fieldset('Secondary');?>

<div class="input-block">
 	<?php
		echo form_label('School Name ', 'sschoolname');
    	echo form_input($sNameSchoolAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('School Address ', 'sschooladdress');
    	echo form_input($sSchoolAddressAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Year Graduated ', 'syeargraduate');
    	echo form_input($sYearGraduateAttrib);	
	?>
</div>

<?php echo form_fieldset_close();?>

<?php echo form_fieldset('Vocational');?>

<div class="input-block">
 	<?php
		echo form_label('School Name ', 'vschoolname');
    	echo form_input($vNameSchoolAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('School Address ', 'vschooladdress');
    	echo form_input($vSchoolAddressAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Year Graduated ', 'vyeargraduate');
    	echo form_input($vYearGraduateAttrib);	
	?>
</div>

<?php echo form_fieldset_close();?>

<?php echo form_fieldset('Tertiary');?>

<div class="input-block">
 	<?php
		echo form_label('School Name ', 'tschoolname');
    	echo form_input($tNameSchoolAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('School Address ', 'tschooladdress');
    	echo form_input($tSchoolAddressAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Year Graduated ', 'tyeargraduate');
    	echo form_input($tYearGraduateAttrib);	
	?>
</div>

<?php echo form_fieldset_close();?>

<?php echo form_fieldset('Others');?>

<div class="input-block">
 	<?php
		echo form_label('School Name ', 'oschoolname');
    	echo form_input($oNameSchoolAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('School Address ', 'oschooladdress');
    	echo form_input($oSchoolAddressAttrib);	
	?>
</div>

<div class="input-block">
 	<?php
		echo form_label('Year Graduated ', 'oyeargraduate');
    	echo form_input($oYearGraduateAttrib);	
	?>
</div>

<?php echo form_fieldset_close();?>


<div class="input-block">
 	<?php echo form_submit('submit', 'Submit');?>
</div>

</div>
</div>
</div>